package alvarodelrosal.chat.client.chataction.local;

import alvarodelrosal.chat.client.chataction.infraestructuraremota.OnlineConversations;
import alvarodelrosal.chat.client.chataction.remote.ChatWhoIsIn;
import alvarodelrosal.chat.client.modelo.Conversation;
import java.util.List;

public class ChatName implements ChatLocalAction {

    @Override
    public String getName() {
        return "ChatName";
    }

    @Override
    public void doAction(List<String> parameters) {
        Conversation conversation = new Conversation(Integer.parseInt(parameters.get(0)),
                parameters.get(1));
        OnlineConversations.addConversation(conversation);
        ChatWhoIsIn in = new ChatWhoIsIn();
        in.doAction(parameters);
    }
}
